package com.freemalll.merchant.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.freemalll.merchant.common.AbstractBaseEntity;
import com.freemalll.merchant.common.CompareField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 商户表
 * </p>
 *
 * @author songshixiong
 * @since 2025-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("mer_merchant")
@Schema(description="MerMerchant对象")
public class MerMerchant extends AbstractBaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId(value = "mer_id", type = IdType.ASSIGN_UUID)
    @CompareField(value = "mer_id", skip = true)
    private String merId;

    @Schema(description = "商户名称")
    @TableField("mer_name")
    @CompareField("mer_name")
    private String merName;

    @Schema(description = "商户简称")
    @TableField("mer_short_name")
    @CompareField("mer_short_name")
    private String merShortName;

    @Schema(description = "拼音全称")
    @TableField("pinyin")
    @CompareField("pinyin")
    private String pinyin;

    @Schema(description = "商户二维码")
    @TableField("new_biz_wechat_qrcode")
    @CompareField("new_biz_wechat_qrcode")
    private String newBizWechatQrcode;

    @Schema(description = "入驻时间")
    @TableField("create_date")
    @CompareField("create_date")
    private LocalDateTime createDate;

    @Schema(description = "商户等级(A、B、C、D、HR)")
    @TableField("mer_level")
    @CompareField("mer_level")
    private String merLevel;

    @Schema(description = "商户额度")
    @TableField("merchant_credit_limit")
    @CompareField("merchant_credit_limit")
    private BigDecimal merchantCreditLimit;

    @Schema(description = "商户连锁店数")
    @TableField("mer_linkage_num")
    @CompareField("mer_linkage_num")
    private Integer merLinkageNum;

    @Schema(description = "是否是流量商户")
    @TableField("traffic_merchant")
    @CompareField("traffic_merchant")
    // 0或者null:否，1是
    private Integer trafficMerchant;

    @Schema(description = "门店类型")
    @TableField("store_type")
    @CompareField("store_type")
    private String storeType;

    @Schema(description = "绑定的销售id，用逗号分割")
    @TableField("sale_persons")
    @CompareField("sale_persons")
    private String salePersons;

    @Schema(description = "申请编码 MAR+两位场景编码（01代表大健康，02代表教育）+两位省份编码+年月日+三位自然数")
    @TableField("apply_code")
    @CompareField("apply_code")
    private String applyCode;

    @Schema(description = "申请类型")
    @TableField("apply_type")
    @CompareField("apply_type")
    private String applyType;

    @Schema(description = "关联商户id")
    @TableField("related_mer_id")
    @CompareField("related_mer_id")
    // 关联商户/分店商户/总店商户都用这个字段
    private String relatedMerId;

    @Schema(description = "品牌类型")
    @TableField("brand_type")
    @CompareField("brand_type")
    private String brandType;

    @Schema(description = "品牌名称")
    @TableField("brand_name")
    @CompareField("brand_name")
    private String brandName;

    @Schema(description = "特殊申请")
    @TableField("special_apply")
    @CompareField("special_apply")
    private String specialApply;

    @Schema(description = "申请政策 多选逗号隔开")
    @TableField("apply_policy")
    @CompareField("apply_policy")
    private String applyPolicy;

    @Schema(description = "申请说明")
    @TableField("apply_desc")
    @CompareField("apply_desc")
    private String applyDesc;

    @Schema(description = "商户模式")
    @TableField("mer_model")
    @CompareField("mer_model")
    //:1直客;2渠道
    private Integer merModel;

    @Schema(description = "场景父类别")
    @TableField("scene_parent_category")
    @CompareField("scene_parent_category")
    private String sceneParentCategory;

    @Schema(description = "场景类别")
    @TableField("scene_category")
    @CompareField("scene_category")
    private String sceneCategory;

    @Schema(description = "获客方式")
    @TableField("customer_acquisition_method")
    @CompareField("customer_acquisition_method")
    private String customerAcquisitionMethod;

    @Schema(description = "商户标签")
    @TableField("label")
    @CompareField("label")
    private String label;

    @Schema(description = "系统状态:[{,全部};{0,待上线};{1,待激活};{2,超时未激活};{3,活跃};{4,轻度睡眠};{5,重度睡眠};{6,不动户}]")
    @TableField("system_status")
    @CompareField("system_status")
    private String systemStatus;

    @Schema(description = "人工状态:{review:激活(待复审)},{end:终止合作}")
    @TableField("man_made_status")
    @CompareField("man_made_status")
    private String manMadeStatus;

    @Schema(description = "添加人oa员工编码用于管理销售表获取大区和省份")
    @TableField("oa_code")
    @CompareField("oa_code")
    private String oaCode;

    @Schema(description = "重新申请关联商户id")
    @TableField("reapply_related_mer_id")
    @CompareField("reapply_related_mer_id")
    private String reapplyRelatedMerId;

}
